<template>
    <UserTable  :key="'index'+data.length"  :tabdata="data"></UserTable>
    <!-- 用户管理 -->
</template>

<script setup lang="ts">
import UserTable from '../../components/UserTable.vue'
import link from '@/util/api';
import { onBeforeMount, ref, watch } from 'vue';
const data:any = ref([])
const getMSG = ()=>{
    link('/getUsers').then( (res: any) => {
        console.log(res.data)
        data.value =  res.data.filter((res:any)=> res.categary==="用户" || res.categary==="扮演者")
    })
}
onBeforeMount(() => {
    getMSG()
})
watch(data.value,getMSG)
</script>

<style scoped>

</style>